<!-- $Id: collection_info.htm 16780 2009-11-09 09:28:30Z sxc_shop $ -->
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,selectzone.js,validator.js"}

<!-- start goods form -->
<div class="tab-div">
  <div id="tabbar-div">
    <p>
      <span class="tab-front" id="general-tab">{$lang.tab_siterule}</span><span
      class="tab-back" id="detail-tab">{$lang.tab_contentrule}</span><span
      class="tab-back" id="goods-tab">{$lang.tab_diyrule}</span>
	  <span class="tab-back" id="pic-tab">{$lang.tab_galleryrule}</span>
	   <span class="tab-back" id="desc-tab">{$lang.tab_descrule}</span>
	  <span class="tab-back" id="comment-tab">{$lang.tab_commentrule}</span>
	  <span class="tab-back" id="high-tab">{$lang.tab_morecfg}</span>
	  <span class="tab-back" id="doc-tab">{$lang.tab_doc}</span>
    </p>
  </div>

  <div id="tabbody-div">
    <form action="collection.php" method="post" enctype="multipart/form-data" name="theForm" onsubmit="return validate();">
    <table width="90%" id="general-table">
      <tr>
        <td class="narrow-label">{$lang.nodename}</td>
		{if $node.id}
		<input type="hidden" name="nodeid" value="{$node.id}"/>
		{/if}
        <td><input type="text" name="name" value="{$node.name}" id="nodename" onblur="check_nodename();"/>&nbsp;<label id="check_nodename" style="color:'red;">{$lang.require_field}</label></td>
      </tr>
	  <tr>
        <td class="narrow-label">{$lang.sourcecharset}</td>
        <td>
        <input type="radio" name="sourcecharset" value="1" {if $node.sourcecharset eq 1}checked{/if}> GB2312
		<input type="radio" name="sourcecharset" value="2" {if $node.sourcecharset eq 2}checked{/if}> GBK   
		<input type="radio" name="sourcecharset" value="3" {if $node.sourcecharset eq 3}checked{/if} {if $node.sourcecharset eq ''}checked{/if}> UTF8
		<input type="radio" name="sourcecharset" value="4" {if $node.sourcecharset eq 4}checked{/if}> BIG5		
	    </td>
      </tr>

	 <tr>
        <td class="narrow-label">{$lang.sourcetype}</td>
        <td>
        <input type="radio" name="sourcetype" value="1" onclick="swithtype(1);" {if $node.sourcetype eq 1}checked{/if} {if $node.sourcetype eq ''}checked{/if}> {$lang.type_list}
		<input type="radio" name="sourcetype" value="2" onclick="swithtype(2);" {if $node.sourcetype eq 2}checked{/if}> {$lang.type_mulit}   
		<input type="radio" name="sourcetype" value="3" onclick="swithtype(3);" {if $node.sourcetype eq 3}checked{/if}> {$lang.type_single}
		<input type="radio" name="sourcetype" value="4" onclick="swithtype(4);" {if $node.sourcetype eq 4}checked{/if}> {$lang.type_json}		
	    </td>
      </tr>
	  
	  
	  
	  <tr class="flexbox" id="flexbox1" {if $node.sourcetype eq ''||$node.sourcetype eq 1}{else}style="display:none";{/if}>
	
		<td class="narrow-label">{$lang.page_cfg}</td>
		<td>
		<input type="text" name="urlpage" style="width:90%;" placeholder="{$lang.target_url}" value="{$node.urlpage}" /><br/>
		<div id="">
			{$lang.page_tips}<br/><br/>
			{$lang.page_from}<input type="text" name="pagesize_start" maxlength="10" value="{$node.pagesize_start}" />
			{$lang.page_to}<input type="text" name="pagesize_end" maxlength="10" value="{$node.pagesize_end}" />
			{$lang.page_delta}
			<input type="text" name="par_num" maxlength="10" width="10px" value="{$node.par_num}" />
		</div>
		<br/>
		</td>
      </tr>
	  
	  <tr class="flexbox" id="flexbox2" {if $node.sourcetype neq 2}style="display:none;"{/if}>
		<td class="narrow-label">{$lang.page_cfg}</td>
		<td>
		<textarea name="urlpage_multi" style="width:90%;height:200px;" placeholder="{$lang.oneline}">{$node.urlpage_multi}</textarea>&nbsp;
		</td>
      </tr>
	  
	  <tr class="flexbox" id="flexbox3" {if $node.sourcetype neq 3}style="display:none;"{/if}>
	
		<td class="narrow-label">{$lang.page_cfg}</td>
		<td>
		<input type="text" name="urlpage_single" style="width:90%;" placeholder="{$lang.target_url}" maxlength="60" value="{$node.urlpage_single}" /><br/>
		</td>
      </tr>
	  
	  <tr class="flexbox" id="flexbox4" {if $node.sourcetype neq 4}style="display:none;"{/if}>
		<td class="narrow-label">{$lang.page_cfg}</td>
		<td align="left" width="70%">
			<input type="text" name="urlpage_json" style="width:90%;" placeholder="{$lang.urlpage_json}" maxlength="60" value="{$node.urlpage_json}" /><br/>
			<br/>
			<textarea name="text_title_sign" style="width:30%;height:65px;" placeholder="{$lang.text_title_sign}">{$node.text_title_sign}</textarea>&nbsp;
			<textarea name="text_url_sign" style="width:30%;height:65px;" placeholder="{$lang.text_url_sign}">{$node.text_url_sign}</textarea>&nbsp;
			<textarea name="text_webhead" style="width:30%;height:65px;" placeholder="{$lang.text_webhead}">{$node.text_webhead}</textarea>&nbsp;
			<br/>
		</td>
	  </tr>
	  
	  
	  <tr>
        <td class="narrow-label">{$lang.page_cfg}</td>
        <td>
        <input type="text" name="url_contain" value="{$node.url_contain}" placeholder="{$lang.url_contain}"/>
        <input type="text" name="url_except" value="{$node.url_except}" placeholder="{$lang.url_except}"/>
		<input type="text" name="url_title_contain" value="{$node.url_title_contain}" placeholder="{$lang.url_title_contain}"/>
        <input type="text" name="url_title_except" value="{$node.url_title_except}" placeholder="{$lang.url_title_except}"/>
	    </td>
      </tr>
	  
	  <tr>
        <td class="narrow-label">{$lang.page_sign}</td>
        <td>
		   <textarea name="page_sign_rule" style="width:85%;height:40px;" placeholder="{$lang.page_sign_rule}">{$node.page_sign_rule}</textarea>&nbsp;
	    </td>
      </tr>
	  

	  <tr>
		<td class="narrow-label">{$lang.page_siterange}</td>
		<td align="left" width="70%">
			<textarea name="url_start" style="width:40%;height:65px;" placeholder="{$lang.url_start}">{$node.url_start}</textarea>&nbsp;
			<textarea name="url_end" style="width:40%;height:65px;" placeholder="{$lang.url_end}">{$node.url_end}</textarea>&nbsp;
		</td>
	</tr>
	  
	
      
    </table>

    <table width="90%" id="detail-table" style="display:none">
	
	<tr>
		<td class="narrow-label">{$lang.rule_goodsname}</td>
		<td align="left" width="90%">
			<textarea name="rule_goods_name"  style="width:30%;height:65px;" placeholder="{$lang.match_rule}">{$node.rule_goods_name}</textarea>&nbsp;
			<textarea name="include_goods_name"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_goods_name}</textarea>&nbsp;
			<textarea name="except_goods_name"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_goods_name}</textarea>&nbsp;
			<textarea name="replace_goods_name"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_goods_name}</textarea>&nbsp;
			<textarea name="replaceto_goods_name"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_goods_name}</textarea>&nbsp;
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.rule_price}</td>
		<td align="left" width="90%">
			<textarea name="rule_shop_price"  style="width:30%;height:65px;" placeholder="{$lang.match_rule}">{$node.rule_shop_price}</textarea>&nbsp;
			<textarea name="include_shop_price"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_shop_price}</textarea>&nbsp;
			<textarea name="except_shop_price"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_shop_price}</textarea>&nbsp;
			<textarea name="replace_shop_price"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_shop_price}</textarea>&nbsp;
			<textarea name="replaceto_shop_price"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_shop_price}</textarea>&nbsp;
			
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.rule_brand}</td>
		<td align="left" width="90%">
			<textarea name="rule_brand" style="width:30%;height:65px;" placeholder="{$lang.match_rule}">{$node.rule_brand}</textarea>&nbsp;
			<textarea name="include_brand"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_brand}</textarea>&nbsp;
			<textarea name="except_brand"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_brand}</textarea>&nbsp;
			<textarea name="replace_brand"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_brand}</textarea>&nbsp;
			<textarea name="replaceto_brand"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_brand}</textarea>&nbsp;
			<br/>
			<input type="checkbox" name="is_create_brand" value="1" {if $node.is_create_brand eq 1}checked{/if}>{$lang.is_create_brand}
			<br/><br/>
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.rule_weight}</td>
		<td align="left" width="90%">
			<textarea name="rule_goods_weight"  style="width:30%;height:65px;" placeholder="{$lang.match_rule}">{$node.rule_goods_weight}</textarea>&nbsp;
			<textarea name="include_goods_weight"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_goods_weight}</textarea>&nbsp;
			<textarea name="except_goods_weight"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_goods_weight}</textarea>&nbsp;
			<textarea name="replace_goods_weight"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_goods_weight}</textarea>&nbsp;
			<textarea name="replaceto_goods_weight"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_goods_weight}</textarea>&nbsp;
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.rule_goodsimg}</td>
		<td align="left" width="90%">
			<textarea name="rule_goods_img"  style="width:30%;height:65px;" placeholder="{$lang.match_rule}">{$node.rule_goods_img}</textarea>&nbsp;
			<textarea name="include_goods_img"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_goods_img}</textarea>&nbsp;
			<textarea name="except_goods_img"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_goods_img}</textarea>&nbsp;
			<textarea name="replace_goods_img"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_goods_img}</textarea>&nbsp;
			<textarea name="replaceto_goods_img"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_goods_img}</textarea>&nbsp;
		</td>
	</tr>
    </table>

    <table width="90%" id="goods-table" style="display:none">
		<tr>
		<td class="narrow-label">{$lang.page_type}</td>
		<td align="left" width="70%">
			
			<select name="catid"  onchange="changeattr(this);">
			<option value="0">{$lang.select_please}</option>
			{foreach from="$cat_list" item="v"}
			<option value="{$v.cat_id}" {if $node.catid eq $v.cat_id}selected{/if}>{$v.cat_name}</option>
			{/foreach}
			</select>
			
		</td>
		</tr>

		{foreach from="$attr_rule" key=k item="attr"}
		<tr class="tr">
			<td class="narrow-label">{$attr.attr_name}</td>
			<td align="left" width="70%">
				<input type="hidden" name="attrruleid[{$k}]" value="{$attr.id}"/>
				<input type="hidden" name="attrid[{$k}]" value="{$attr.attr_id}"/>
				<input type="hidden" name="attrname[{$k}]" value="{$attr.attr_name}"/>
				<textarea name="rule_content[{$k}]"  style="width:30%;height:65px;" placeholder="{$lang.match_rule}">{$attr.rule_content}</textarea>&nbsp;
				<textarea name="rule_include[{$k}]"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$attr.rule_include}</textarea>&nbsp;
				<textarea name="rule_except[{$k}]"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$attr.rule_except}</textarea>&nbsp;
				<textarea name="rule_replace[{$k}]"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$attr.rule_replace}</textarea>&nbsp;
				<textarea name="rule_replaceto[{$k}]"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$attr.rule_replaceto}</textarea>&nbsp;
			</td>
		</tr>
		{/foreach}
		
    </table>
	
	<!---商品图片获取--->
	<table width="98%" id="pic-table" style="display:none">
	<tr>
		<td class="narrow-label" >{$lang.title_pic_async}</td>
		<td align="left" width="100%" >
			<input type="checkbox" name="is_gallery_async" value="1" {if $node.is_gallery_async eq 1}checked{/if}>{$lang.is_gallery_async}
			<br/>
			<p>
			{$lang.gallery_url_get_type}：
			<input type="radio" name="gallery_url_get_type" value="0" onclick="switch_cfg_tab('gallery_url_get_type',0);" {if $node.gallery_url_get_type eq '0' || $node.gallery_url_get_type eq ''}checked{/if}/>{$lang.type_url} &nbsp;&nbsp;
			<input type="radio" name="gallery_url_get_type" value="1" onclick="switch_cfg_tab('gallery_url_get_type',1);" {if $node.gallery_url_get_type eq '1'}checked{/if}/>{$lang.type_reg} &nbsp;&nbsp;&nbsp;&nbsp;
			</p>
			<div class="gallery_url_get_type_box">
				<div class="gallery_url_get_type" {if $node.gallery_url_get_type neq '0' && $node.gallery_url_get_type neq ''}style="display:none;"{/if}>
					<textarea name="json_gallery_async_url"  style="width:90%;height:60px;" placeholder="{$lang.json_url_type}">{$node.json_gallery_async_url}</textarea>&nbsp;
				</div>
				<div class="gallery_url_get_type" {if $node.gallery_url_get_type neq '1'}style="display:none;"{/if}>
					<textarea name="rule_gallery_async_url"  style="width:30%;height:65px;" placeholder="{$lang.match_rule},(*)表示页码">{$node.rule_gallery_async_url}</textarea>&nbsp;
					<textarea name="include_gallery_async_url"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_gallery_async_url}</textarea>&nbsp;
					<textarea name="except_gallery_async_url"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_gallery_async_url}</textarea>&nbsp;
					<textarea name="replace_gallery_async_url"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_gallery_async_url}</textarea>&nbsp;
					<textarea name="replaceto_gallery_async_url"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_gallery_async_url}</textarea>&nbsp;
				</div>		
			</div>
			<br/>
		</td>
	</tr>
	
	<tr >
		<td class="narrow-label">{$lang.gallery_data_type}</td>
		<td align="left" width="100%">
			<input type="radio" name="gallery_data_type" value="0" onclick="switch_cfg_tab('gallery_data_type',0);" {if $node.gallery_data_type eq '0' || $node.gallery_data_type eq ''}checked{/if}/>HTML &nbsp;&nbsp;
			<input type="radio" name="gallery_data_type" value="1" onclick="switch_cfg_tab('gallery_data_type',1);" {if $node.gallery_data_type eq '1'}checked{/if}/>JSON &nbsp;&nbsp;&nbsp;&nbsp;
			<br/>
			<div class="gallery_data_type_box">
				<div class="gallery_data_type" {if $node.gallery_data_type neq '0' && $node.gallery_data_type neq ''}style="display:none;"{/if}>
					<p>{$lang.gallery_range}：</p>
					<textarea name="gallery_start" style="width:45%;height:65px;" placeholder="{$lang.gallery_start}">{$node.gallery_start}</textarea>&nbsp;
					<textarea name="gallery_end" style="width:45%;height:65px;" placeholder="{$lang.gallery_end}">{$node.gallery_end}</textarea>&nbsp;
					<br/>
					<p>{$lang.rule_goods_gallery}：</p>
					<textarea name="rule_goods_gallery"  style="width:96%;height:65px;" placeholder="{$lang.match_rule}，{$lang.gallery_multi}">{$node.rule_goods_gallery}</textarea>&nbsp;
					
				</div>
				<div class="gallery_data_type" {if $node.gallery_data_type neq '1'}style="display:none;"{/if}>
					<p>
					{$lang.data_set}:&nbsp;
					<input type="checkbox" name="gallery_data_jsonp" value="1" {if $node.gallery_data_jsonp eq 1}checked{/if}>{$lang.cut_data_jsonp} &nbsp;
					</p>
					{$lang.gallery_data_key}：<input type="text" name="gallery_data_key" value="{$node.gallery_data_key}" style="width:300px;height:20px;" placeholder="{$lang.find_data_key_tips}"/>
					
					<p>{$lang.gallery_src_type}：</p>
					<input type="radio" name="gallery_src_type" value="0" {if $node.gallery_src_type eq '0' || $node.gallery_src_type eq ''}checked{/if}/>{$lang.g_one_mulit}<br/>
					<p>
					<input type="radio" name="gallery_src_type" value="1" {if $node.gallery_src_type eq '1'}checked{/if}/>{$lang.g_one_one} ：&nbsp;
					<input type="text" name="gallery_src_type_separator" style="width:200px;height:20px;" placeholder="{$lang.gallery_src_type_separator}" value="{$node.gallery_src_type_separator}"/>
					</p>
					<input type="radio" name="gallery_src_type" value="2" {if $node.gallery_src_type eq '2'}checked{/if}/> {$lang.g_multi_multi}：&nbsp;
					<input type="text" name="gallery_src_type_key" style="width:200px;height:20px;" placeholder="{$lang.gallery_src_type_key}" value="{$node.gallery_src_type_key}"/>
					<br/><br/>
				</div>		
			</div>
			<textarea name="include_goods_gallery"  style="width:23%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_goods_gallery}</textarea>&nbsp;
			<textarea name="except_goods_gallery"  style="width:23%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_goods_gallery}</textarea>&nbsp;
			<textarea name="replace_goods_gallery"  style="width:23%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_goods_gallery}</textarea>&nbsp;
			<textarea name="replaceto_goods_gallery"  style="width:23%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_goods_gallery}</textarea>&nbsp;
			<br/>
			*{$lang.gallery_tips}<br/><br/>
			
		</td>
	</tr>
	<tr >
		<td class="narrow-label">{$lang.gallery_set}</td>
		<td align="left" width="100%">
			{$lang.gallery_num_limit}：<input type="text" name="gallery_num_limit" style="width:200px;" placeholder="0为无限制" value="{$node.gallery_num_limit}"/>
			<br/><br/>
			<input type="checkbox" name="is_gallery_download" value="1" {if $node.is_gallery_download eq 1}checked{/if}>{$lang.is_gallery_download}
		</td>
	</tr>
	</table>
	
	
	
	<!---描述获取--->
	<table width="98%" id="desc-table" style="display:none">
	<tr>
		<td class="narrow-label">{$lang.title_is_desc_lazyload}</td>
		<td align="left" width="90%">
			<input type="checkbox" name="is_desc_lazyload" value="1" {if $node.is_desc_lazyload eq 1}checked{/if}>{$lang.is_desc_lazyload}
			<br/>
			<p>
			{$lang.gallery_url_get_type}：
			<input type="radio" name="desc_url_get_type" value="0" onclick="switch_cfg_tab('desc_url_get_type',0);" {if $node.desc_url_get_type eq '0' || $node.desc_url_get_type eq ''}checked{/if}/>{$lang.type_url} &nbsp;&nbsp;
			<input type="radio" name="desc_url_get_type" value="1" onclick="switch_cfg_tab('desc_url_get_type',1);" {if $node.desc_url_get_type eq '1'}checked{/if}/>{$lang.type_reg} &nbsp;&nbsp;&nbsp;&nbsp;
			</p>
			<div class="desc_url_get_type_box">
				<div class="desc_url_get_type" {if $node.desc_url_get_type neq '0' && $node.desc_url_get_type neq ''}style="display:none;"{/if}>
					<textarea name="json_desc_lazyload_url"  style="width:90%;height:60px;" placeholder="{$lang.json_url_type}">{$node.json_desc_lazyload_url}</textarea>&nbsp;
				</div>
				<div class="desc_url_get_type" {if $node.desc_url_get_type neq '1'}style="display:none;"{/if}>
					<textarea name="rule_desc_lazyload_url"  style="width:30%;height:65px;" placeholder="{$lang.match_rule},(*)表示页码">{$node.rule_desc_lazyload_url}</textarea>&nbsp;
					<textarea name="include_desc_lazyload_url"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_desc_lazyload_url}</textarea>&nbsp;
					<textarea name="except_desc_lazyload_url"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_desc_lazyload_url}</textarea>&nbsp;
					<textarea name="replace_desc_lazyload_url"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_desc_lazyload_url}</textarea>&nbsp;
					<textarea name="replaceto_desc_lazyload_url"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_desc_lazyload_url}</textarea>&nbsp;
				</div>		
			</div>
			<br/>
		</td>
	</tr>
	<tr >
		<td class="narrow-label">{$lang.gallery_data_type}</td>
		<td align="left" width="100%">
			<input type="radio" name="desc_data_type" value="0" onclick="switch_cfg_tab('desc_data_type',0);" {if $node.desc_data_type eq '0' || $node.desc_data_type eq ''}checked{/if}/>HTML &nbsp;&nbsp;
			<input type="radio" name="desc_data_type" value="1" onclick="switch_cfg_tab('desc_data_type',1);" {if $node.desc_data_type eq '1'}checked{/if}/>JSON &nbsp;&nbsp;&nbsp;&nbsp;
			<br/><br/>
			<div class="desc_data_type_box">
				<div class="desc_data_type" {if $node.desc_data_type neq '0' && $node.desc_data_type neq ''}style="display:none;"{/if}>
					<textarea name="rule_goods_desc" style="width:40%;height:65px;" placeholder="{$lang.match_rule}">{$node.rule_goods_desc}</textarea>&nbsp;
					<textarea name="include_goods_desc" style="width:25%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_goods_desc}</textarea>&nbsp;
					<textarea name="except_goods_desc" style="width:25%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_goods_desc}</textarea>&nbsp;
					
				</div>
				<div class="desc_data_type" {if $node.desc_data_type neq 1}style="display:none;"{/if}>
					{$lang.data_set}:&nbsp;
					<input type="checkbox" name="desc_data_jsonp" value="1" {if $node.desc_data_jsonp eq 1}checked{/if}>{$lang.cut_data_jsonp} &nbsp;
					<br/><br/>
					{$lang.find_data_key}：<input type="text" name="desc_data_key" value="{$node.desc_data_key}" style="width:200px;height:18px" placeholder="{$lang.find_data_key_tips}"/>
					<br/><br/>
				</div>		
			</div>
			<textarea name="replace_goods_desc"  style="width:46%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_goods_desc}</textarea>&nbsp;
			<textarea name="replaceto_goods_desc"  style="width:46%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_goods_desc}</textarea>&nbsp;
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.gallery_set}</td>
		<td align="left" width="90%">
		<input type="checkbox" name="desc_img_download" value="1" {if $node.desc_img_download eq 1}checked{/if}> {$lang.desc_img_download}
		<br/>
		</td>
	</tr>
    </table>
	
	<!---评价获取--->
	<table width="98%" id="comment-table" style="display:none">
	<tr>
		<td class="narrow-label" >{$lang.title_is_comment_multiload}</td>
		<td align="left" width="100%" >
			<input type="checkbox" name="is_comment_multiload" value="1" {if $node.is_comment_multiload eq '1'}checked{/if}>{$lang.is_comment_multiload}
			<p>
			{$lang.c_top_limit}：<input type="text" name="comment_pagenum" value="{$node.comment_pagenum}" style="width:100px;height:18px;" placeholder="{$lang.must}"/>&nbsp;{$lang.page}
			</p><p>
			{$lang.c_top_limit}：<input type="text" name="comment_issuenum" value="{$node.comment_issuenum}" style="width:100px;height:18px;" placeholder="{$lang.empty_limit}"/>&nbsp;{$lang.issue}
			</p><p>
			{$lang.gallery_url_get_type}：
			<input type="radio" name="comment_url_get_type" value="0" onclick="switch_cfg_tab('comment_url_get_type',0);" {if $node.comment_url_get_type eq '0' || $node.comment_url_get_type eq ''}checked{/if}/>{$lang.type_url} &nbsp;&nbsp;
			<input type="radio" name="comment_url_get_type" value="1" onclick="switch_cfg_tab('comment_url_get_type',1);" {if $node.comment_url_get_type eq '1'}checked{/if}/>{$lang.type_reg} &nbsp;&nbsp;&nbsp;&nbsp;
			</p>
			<div class="comment_url_get_type_box">
				<div class="comment_url_get_type" {if $node.comment_url_get_type neq '0' && $node.comment_url_get_type neq ''}style="display:none;"{/if}>
					<textarea name="json_comment_multiload_url"  style="width:90%;height:60px;" placeholder="{$lang.json_url_type}">{$node.json_comment_multiload_url}</textarea>&nbsp;
				</div>
				<div class="comment_url_get_type" {if $node.comment_url_get_type neq '1'}style="display:none;"{/if}>
					<textarea name="rule_comment_multiload_url"  style="width:30%;height:65px;" placeholder="{$lang.match_rule},(*)表示页码">{$node.rule_comment_multiload_url}</textarea>&nbsp;
					<textarea name="include_comment_multiload_url"  style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_comment_multiload_url}</textarea>&nbsp;
					<textarea name="except_comment_multiload_url"  style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_comment_multiload_url}</textarea>&nbsp;
					<textarea name="replace_comment_multiload_url"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_comment_multiload_url}</textarea>&nbsp;
					<textarea name="replaceto_comment_multiload_url"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_comment_multiload_url}</textarea>&nbsp;
				</div>		
			</div>
			<br/>
		</td>
	</tr>
	
	<tr >
		<td class="narrow-label">{$lang.gallery_data_type}</td>
		<td align="left" width="100%">
			<input type="radio" name="comment_data_type" value="0" onclick="switch_cfg_tab('comment_data_type',0);" {if $node.comment_data_type eq '0' || $node.comment_data_type eq ''}checked{/if}/>HTML &nbsp;&nbsp;
			<input type="radio" name="comment_data_type" value="1" onclick="switch_cfg_tab('comment_data_type',1);" {if $node.comment_data_type eq '1'}checked{/if}/>JSON &nbsp;&nbsp;&nbsp;&nbsp;
			<br/><br/>
			<div class="comment_data_type_box">
				<div class="comment_data_type" {if $node.comment_data_type neq '0' && $node.comment_data_type neq ''}style="display:none;"{/if}>
					<p>{$lang.comment_range}：</p>
					<textarea name="comment_start" style="width:40%;height:65px;" placeholder="{$lang.comment_start}">{$node.comment_start}</textarea>&nbsp;
					<textarea name="comment_end" style="width:40%;height:65px;" placeholder="{$lang.comment_end}">{$node.comment_end}</textarea>&nbsp;
					<br/>
					<p>{$lang.comment_a_range}：</p>
					<textarea name="comment_one_start" style="width:40%;height:65px;" placeholder="{$lang.comment_one_start}">{$node.comment_one_start}</textarea>&nbsp;
					<textarea name="comment_one_end" style="width:40%;height:65px;" placeholder="{$lang.comment_one_end}">{$node.comment_one_end}</textarea>&nbsp;
					<br/>
					*{$lang.comment_mtips}
					<br/><br/>
				</div>
				<div class="comment_data_type" {if $node.comment_data_type neq '1'}style="display:none;"{/if}>
					{$lang.data_set}:&nbsp;
					<input type="checkbox" name="comment_data_jsonp" value="1" {if $node.comment_data_jsonp eq 1}checked{/if}>{$lang.cut_data_jsonp} &nbsp;
					<br/><p>
					{$lang.find_data_key}：<input type="text" name="comment_data_key" value="{$node.comment_data_key}" style="width:200px;height:20px;" placeholder="{$lang.find_data_key_tips}"/>
					</p>
				</div>		
			</div>
		</td>
	</tr>
	
	<tr>
		<td class="narrow-label">{$lang.comment_user}</td>
		<td align="left" width="100%">
		<textarea name="rule_comment_user" style="width:30%;height:65px;" placeholder="{$lang.match_rule_key};{$lang.json_key_tips}">{$node.rule_comment_user}</textarea>&nbsp;
		<textarea name="include_comment_user" style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_comment_user}</textarea>&nbsp;
		<textarea name="except_comment_user" style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_comment_user}</textarea>&nbsp;
		<textarea name="replace_comment_user"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_comment_user}</textarea>&nbsp;
		<textarea name="replaceto_comment_user"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_comment_user}</textarea>&nbsp;
		<div>
		<input type="checkbox" name="is_add_comment_user" value="1" {if $node.is_add_comment_user eq 1}checked{/if}> {$lang.is_add_comment_user}
		<br/><br/><br/>
		</div>
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.comment_content}</td>
		<td align="left" width="90%">
		<textarea name="rule_comment_content" style="width:30%;height:65px;" placeholder="{$lang.match_rule_key}">{$node.rule_comment_content}</textarea>&nbsp;
		<textarea name="include_comment_content" style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_comment_content}</textarea>&nbsp;
		<textarea name="except_comment_content" style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_comment_content}</textarea>&nbsp;
		<textarea name="replace_comment_content"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_comment_content}</textarea>&nbsp;
		<textarea name="replaceto_comment_content"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_comment_content}</textarea>&nbsp;
		<br/>
		<input type="checkbox" name="comment_img_download" value="1" {if $node.comment_img_download eq 1}checked{/if}>{$lang.comment_img_download}
		<br/>
		<br/>
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.comment_rank}</td>
		<td align="left" width="90%">
		<textarea name="rule_comment_rank" style="width:30%;height:65px;" placeholder="{$lang.match_rule_key}">{$node.rule_comment_rank}</textarea>&nbsp;
		<textarea name="include_comment_rank" style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_comment_rank}</textarea>&nbsp;
		<textarea name="except_comment_rank" style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_comment_rank}</textarea>&nbsp;
		<textarea name="replace_comment_rank"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_comment_rank}</textarea>&nbsp;
		<textarea name="replaceto_comment_rank"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_comment_rank}</textarea>&nbsp;
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.comment_time}</td>
		<td align="left" width="90%">
		<textarea name="rule_comment_time" style="width:30%;height:65px;" placeholder="{$lang.match_rule_key}">{$node.rule_comment_time}</textarea>&nbsp;
		<textarea name="include_comment_time" style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_comment_time}</textarea>&nbsp;
		<textarea name="except_comment_time" style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_comment_time}</textarea>&nbsp;
		<textarea name="replace_comment_time"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_comment_time}</textarea>&nbsp;
		<textarea name="replaceto_comment_time"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_comment_time}</textarea>&nbsp;
		
		<br/>
		<input type="checkbox" name="is_timestamp_format" value="1" {if $node.is_timestamp_format eq 1}checked{/if}>{$lang.is_timestamp_format}
		<br/>
		<br/>
		</td>
	</tr>
	<tr>
		<td class="narrow-label">{$lang.comment_extimg}</td>
		<td align="left" width="90%">
		<textarea name="rule_comment_extimg" style="width:30%;height:65px;" placeholder="{$lang.match_rule_key}">{$node.rule_comment_extimg}</textarea>&nbsp;
		<textarea name="include_comment_extimg" style="width:15%;height:65px;" placeholder="{$lang.include_rule}">{$node.include_comment_extimg}</textarea>&nbsp;
		<textarea name="except_comment_extimg" style="width:15%;height:65px;" placeholder="{$lang.except_rule}">{$node.except_comment_extimg}</textarea>&nbsp;
		<textarea name="replace_comment_extimg"  style="width:15%;height:65px;" placeholder="{$lang.replace_rule}">{$node.replace_comment_extimg}</textarea>&nbsp;
		<textarea name="replaceto_comment_extimg"  style="width:15%;height:65px;" placeholder="{$lang.replaceto_rule}">{$node.replaceto_comment_extimg}</textarea>&nbsp;
		<br/>

		<input type="checkbox" name="comment_extimg_download" value="1" {if $node.comment_extimg_download eq 1}checked{/if}>{$lang.comment_extimg_download}
		<br/>
		
		</td>
	</tr>
	
    </table>
	
	
	<table width="90%" id="high-table" style="display:none">
	<tr>
		<td class="narrow-label">{$lang.title_per_collect_num}</td>
		<td align="left" width="90%">
			<input type="text" name="per_collect_num" style="width:50%;" value="{$node.per_collect_num}" placeholder="{$lang.per_collect_num}"/>
		</td>
	</tr>
	
	<tr>
		<td class="narrow-label">
		{$lang.img_src_names}</td>
		<td align="left" width="90%">
			<input type="text" name="img_src_names" style="width:90%;" value="{$node.img_src_names}" placeholder="{$lang.src_names_tips}"/>
		</td>
	</tr>
	<tr>
		<td class="narrow-label">
		{$lang.goods_img_url_completion}</td>
		<td align="left" width="90%">
			<input type="text" name="goods_img_url_completion" style="width:90%;" value="{$node.goods_img_url_completion}" placeholder="{$lang.url_completion_tips}"/>
		</td>
	</tr>
	<tr>
		<td class="narrow-label">
		{$lang.gallery_img_url_completion}</td>
		<td align="left" width="90%">
			<input type="text" name="gallery_img_url_completion" style="width:90%;" value="{$node.gallery_img_url_completion}" placeholder="{$lang.url_completion_tips}"/>
		</td>
	</tr>
	<tr>
		<td class="narrow-label">
		{$lang.desc_img_url_completion}</td>
		<td align="left" width="90%">
			<input type="text" name="desc_img_url_completion" style="width:90%;" value="{$node.desc_img_url_completion}" placeholder="{$lang.url_completion_tips}"/>
		</td>
	</tr>
	<tr>
		<td class="narrow-label">
		{$lang.comment_img_url_completion}</td>
		<td align="left" width="90%">
			<input type="text" name="comment_img_url_completion" style="width:90%;" value="{$node.comment_img_url_completion}" placeholder="{$lang.url_completion_tips}"/>
			<br/>
		</td>
	</tr>
	
	<tr>
		<td class="narrow-label">
		{$lang.get_extfield}</td>
		<td align="left" width="100%">
			<p>
			<input type="button" onclick="add_fieldbox()" value="{$lang.add_a_line}" class="button"/>
			<input type="button" onclick="del_fieldbox()" value="{$lang.delete_bottom_line}" class="button"/>
			</p>
			<div id="field_cnt">
				{if count($fields)>0}
				{foreach from="$fields" item='field' key='fk'}
				<div class="fieldbox">
					<input type="hidden" name="field_id[{$fk}]" value="{$fk}">
					<textarea name="field_name[{$fk}]"  style="width:10%;height:45px;" placeholder="{$lang.field_name}">{$field.field_name}</textarea>&nbsp;
					<textarea name="field_rule_match[{$fk}]"  style="width:30%;height:45px;" placeholder="{$lang.match_rule}">{$field.field_rule_match}</textarea>&nbsp;
					<textarea name="field_rule_include[{$fk}]"  style="width:10%;height:45px;" placeholder="{$lang.include_rule}">{$field.field_rule_include}</textarea>&nbsp;
					<textarea name="field_rule_except[{$fk}]"  style="width:10%;height:45px;" placeholder="{$lang.except_rule}">{$field.field_rule_except}</textarea>&nbsp;
					<textarea name="field_rule_replace[{$fk}]"  style="width:12%;height:45px;" placeholder="{$lang.replace_rule}">{$field.field_rule_replace}</textarea>&nbsp;
					<textarea name="field_rule_replaceto[{$fk}]"  style="width:12%;height:45px;" placeholder="{$lang.replaceto_rule}">{$field.field_rule_replaceto}</textarea>&nbsp;
				</div>
				{/foreach}
				{else}
				<div class="fieldbox">
					<textarea name="field_name[0]"  style="width:10%;height:45px;" placeholder="{$lang.field_name}"></textarea>&nbsp;
					<textarea name="field_rule_match[0]"  style="width:30%;height:45px;" placeholder="{$lang.match_rule}"></textarea>&nbsp;
					<textarea name="field_rule_include[0]"  style="width:10%;height:45px;" placeholder="{$lang.include_rule}"></textarea>&nbsp;
					<textarea name="field_rule_except[0]"  style="width:10%;height:45px;" placeholder="{$lang.except_rule}"></textarea>&nbsp;
					<textarea name="field_rule_replace[0]"  style="width:12%;height:45px;" placeholder="{$lang.replace_rule}"></textarea>&nbsp;
					<textarea name="field_rule_replaceto[0]"  style="width:12%;height:45px;" placeholder="{$lang.replaceto_rule}"></textarea>&nbsp;
				</div>
				{/if}
			</div>
		</td>
	</tr>
	
	<tr>
		<td class="narrow-label">
		{$lang.all_replace}</td>
		<td align="left" width="100%">
			<p>*{$lang.all_replace_tips}</p>
			<p>
			<input type="button"  onclick="add_replacebox()" value="{$lang.add_a_line}" class="button"/>
			<input type="button" onclick="del_replacebox()" value="{$lang.delete_bottom_line}" class="button"/>
			</p>
			<div id="replace_cnt">
				{if count($replaces)>0}
				{foreach from="$replaces" item='replace' key='rk'}
				<div class="replacebox">
					<textarea name="replace_from[{$rk}]"  style="width:50%;height:60px;" placeholder="{$lang.replace_from}">{$replace.replace_from}</textarea>&nbsp;
					<textarea name="replace_to[{$rk}]"  style="width:40%;height:60px;" placeholder="{$lang.replace_to}">{$replace.replace_to}</textarea>&nbsp;
				</div>
				{/foreach}
				{else}
				<div class="replacebox">
					<textarea name="replace_from[0]"  style="width:50%;height:60px;" placeholder="{$lang.replace_from}"></textarea>&nbsp;
					<textarea name="replace_to[0]"  style="width:40%;height:60px;" placeholder="{$lang.replace_to}"></textarea>&nbsp;
				</div>
				{/if}
			</div>
		</td>
	</tr>
    </table>
	
	
	<table width="90%" id="doc-table" style="display:none">
	
	<tr>
		<td class="narrow-label">匹配说明：</td>
		<td align="left" width="90%">
			<ol>
				<li>[内容]可以获取任意内容</li>
				<li>[字符]可以获取以单双引号包围的内容</li>
				<li>[书写]可以获取中括号包围的内容</li>
				<li>[标签]可以获取被“><”号包围的内容</li>
				<li>---上面匹配标签开头加除字，可以匹配但不获取其内容---</li>				
				<li>[页码]，[数字]可以获取数字页码</li>
				<li>直接写匹配规则，程序会自动解析为正则格式；以[reg]开头，程序会直接使用该规则</li>
			</ol>
		</td>
	</tr>
			
	<tr>
		<td class="narrow-label">自定义字段说明：</td>
		<td align="left" width="90%">
				自定义字段可以获取页面中的数据，使用到匹配其他数据的规则中。
				<br/>使用该自定义字段时，以[自定义字段名]来匹配内容。
		</td>
	</tr>
			
	<tr>
		<td class="narrow-label">图片src补全说明：</td>
		<td align="left" width="90%">
			获取的图片链接有可能并不全，使该链接无法使用和下载。<br/>
			在对应的src补全框中填入补全的完整链接，需要加http://开头
		</td>
	</tr>
			
	<tr>
		<td class="narrow-label">图片src名说明：</td>
		<td align="left" width="90%">
			某些网站使用异步加载的图片数据有可能并不不是以src标签命名，这时候将该标签名填入此处，使程序可以匹配到图片链接。</p>
		</td>
	</tr>
			
	<tr>
		<td class="narrow-label">作者说明：</td>
		<td align="left" width="90%">
			本程序由《<a href="http://www.cnblogs.com/GaZeon/" target="_blank">CNblog@YunGaZeon</a>》开发，撸码不易，你可以在保留作者名的情况下任意使用。
			BUG反馈或修正可以到<a href="http://git.oschina.net/gazeon/ecshop_collection_extension">码云</a>。
		</td>
	</tr>
	
	
	
    </table>
	
	
	
	
	
	
	
    <div class="button-div">
      <input type="hidden" name="act" value="{$form_action}" />
      <input type="hidden" name="old_title" value="{$node.name}"/>
      <input type="hidden" name="id" value="{$node.id}" />
      <input type="submit" value="{$lang.button_submit}" class="button"  />
      <input type="reset" value="{$lang.button_reset}" class="button" />
    </div>
    </form>
  </div>

</div>
<!-- end goods form -->
<script language="JavaScript">


function switch_cfg_tab(classname,index)
{
	var cgt=document.getElementsByClassName(classname);
	for(var i=0;i<cgt.length;i++)
	{
		if(i==index)
			cgt[i].style.display='block';
		else
			cgt[i].style.display='none';
	}
}

function changeattr(o)
{
	var trs=document.getElementsByClassName('tr');
	while(trs.length>0)
	{
		trs[0].parentNode.removeChild(trs[0]);
	}
	
	Ajax.call('collection.php?act=get_attr_list', 'cat_id='+o.value, changeattrbox, 'POST', 'JSON');
	
}

function changeattrbox(result)
{
var ab=document.getElementById('goods-table');
	if(result!=0)
	{

		var html='';
		var mr='{$lang.match_rule}';
		var er='{$lang.except_rule}';
		var ir='{$lang.include_rule}';
		var rr='{$lang.replace_rule}';
		var rtr='{$lang.replaceto_rule}';
		for(var i=0;i<result.length;i++)
		{
			var k=ab.insertRow(i+1);
			var one=k.insertCell(0);
			var two=k.insertCell(1);
			k.className='tr';
			k.id='tr'+i;
			one.innerHTML=result[i].attr_name;
			one.className="narrow-label";
			two.innerHTML='<input type="hidden" name="attrid['+i+']" value="'+result[i].attr_id+'"/><input type="hidden" name="attrname['+i+']" value="'+result[i].attr_name+'"/><textarea name="rule_content['+i+']" style="width:30%;height:65px;" placeholder="'+mr+'"></textarea>&nbsp;<textarea name="rule_include['+i+']" style="width:15%;height:65px;" placeholder="'+ir+'"></textarea>&nbsp;<textarea name="rule_except['+i+']" style="width:15%;height:65px;" placeholder="'+er+'"></textarea>&nbsp;<textarea name="rule_replace['+i+']" style="width:15%;height:65px;" placeholder="'+rr+'"></textarea>&nbsp;<textarea name="rule_replaceto['+i+']" style="width:15%;height:65px;" placeholder="'+rtr+'"></textarea>&nbsp;';
			two.style.width='70%';
		}
		
	}
  
	
}

function add_fieldbox()
{
	var cnt=document.getElementById('field_cnt');
	var index=parseInt(document.getElementsByClassName('fieldbox').length)+1;
	
	var nm='{$lang.field_name}';
	var mr='{$lang.match_rule}';
	var er='{$lang.except_rule}';
	var ir='{$lang.include_rule}';
	var rr='{$lang.replace_rule}';
	var rtr='{$lang.replaceto_rule}';

	var fieldbox=document.createElement('div');
	fieldbox.className="fieldbox";
	
	var t=document.createElement('textarea');
	t.name='field_name['+index+']';
	t.style="width:10%;height:35px;margin-right:6px;";
	t.placeholder=nm;
	fieldbox.appendChild(t);
	
	t=document.createElement('textarea');
	t.name='field_rule_match['+index+']';
	t.style="width:30%;height:35px;margin-right:6px;";
	t.placeholder=mr;
	fieldbox.appendChild(t);
	
	t=document.createElement('textarea');
	t.name='field_rule_include['+index+']';
	t.style="width:10%;height:35px;margin-right:6px;";
	t.placeholder=ir;
	fieldbox.appendChild(t);
	
	t=document.createElement('textarea');
	t.name='field_rule_except['+index+']';
	t.style="width:10%;height:35px;margin-right:6px;";
	t.placeholder=er;
	fieldbox.appendChild(t);
	
	t=document.createElement('textarea');
	t.name='field_rule_replace['+index+']';
	t.style="width:10%;height:35px;margin-right:6px;";
	t.placeholder=rr;
	fieldbox.appendChild(t);
	
	t=document.createElement('textarea');
	t.name='field_rule_replaceto['+index+']';
	t.style="width:10%;height:35px;margin-right:6px;";
	t.placeholder=rtr;
	fieldbox.appendChild(t);
	
	
	t=document.createElement('p');

	fieldbox.appendChild(t);
	
	cnt.appendChild(fieldbox);
	
}

function del_fieldbox()
{
	var boxs=document.getElementsByClassName('fieldbox');
	if(boxs.length>0)
		document.getElementById('field_cnt').removeChild(boxs[boxs.length-1]);
}

function add_replacebox()
{
	var rf="{$lang.replace_from}";
	var rt='{$lang.replace_to}';
	var cnt=document.getElementById('replace_cnt');
	var index=parseInt(document.getElementsByClassName('replacebox').length)+1;

	var replacebox=document.createElement('div');
	replacebox.className="replacebox";
	
	var t=document.createElement('textarea');
	t.name='replace_from['+index+']';
	t.style="width:50%;height:60px;margin-right:6px;";
	t.placeholder=rf;
	replacebox.appendChild(t);
	
	t=document.createElement('textarea');
	t.name='replace_to['+index+']';
	t.style="width:40%;height:60px;margin-right:6px;";
	t.placeholder=rt;
	replacebox.appendChild(t);
	
	t=document.createElement('p');
	replacebox.appendChild(t);
	
	cnt.appendChild(replacebox);
	
}

function del_replacebox()
{
	var boxs=document.getElementsByClassName('replacebox');
	if(boxs.length>0)
		document.getElementById('replace_cnt').removeChild(boxs[boxs.length-1]);
}


function check_nodename()
{
	var nodename=document.getElementById('nodename').value;
	var node=document.getElementById('check_nodename');
	if(nodename=='')
	{
		node.innerHTML="请填写节点名";
	}
	else
	{
		Ajax.call('collection.php?act=node_namecheck', 'name='+nodename, function(msg){
			if(msg.error==1)
				node.innerHTML='该节点名已存在';
			else
				node.innerHTML='<span><img src="images/yes.gif"/></span>';
		}, 'POST', 'JSON');
	}
}


var collectionId = {$node.collection_id|default:0};
var elements  = document.forms['theForm'].elements;
var sz        = new SelectZone(1, elements['source_select'], elements['target_select'], '');

{literal}
onload = function()
{
  // 开始检查订单
  startCheckOrder();
  
  //hoverbox();
}

function hoverbox()
{
	var boxs=document.getElementsByClassName('flexbox');
  for(var i=0;i<boxs.length;i++)
  {
	boxs[i].style.display="none";
  }
}

function swithtype($type)
{
	hoverbox();
	document.getElementById('flexbox'+$type).style.display="";
}


function validate()
{
  var validator = new Validator('theForm');
  return validator.passed();
}





document.getElementById("tabbar-div").onmouseover = function(e)
{
    var obj = Utils.srcElement(e);

    if (obj.className == "tab-back")
    {
        obj.className = "tab-hover";
    }
}

document.getElementById("tabbar-div").onmouseout = function(e)
{
    var obj = Utils.srcElement(e);

    if (obj.className == "tab-hover")
    {
        obj.className = "tab-back";
    }
}

document.getElementById("tabbar-div").onclick = function(e)
{
    var obj = Utils.srcElement(e);

    if (obj.className == "tab-front")
    {
        return;
    }
    else
    {
        objTable = obj.id.substring(0, obj.id.lastIndexOf("-")) + "-table";

        var tables = document.getElementsByTagName("table");
        var spans  = document.getElementsByTagName("span");

        for (i = 0; i < tables.length; i++)
        {
            if (tables[i].id == objTable)
            {
                tables[i].style.display = (Browser.isIE) ? "block" : "table";
            }
            else
            {
                tables[i].style.display = "none";
            }
        }
        for (i = 0; spans.length; i++)
        {
            if (spans[i].className == "tab-front")
            {
                spans[i].className = "tab-back";
                obj.className = "tab-front";
                break;
            }
        }
    }
}

function showNotice(objId)
{
    var obj = document.getElementById(objId);

    if (obj)
    {
        if (obj.style.display != "block")
        {
            obj.style.display = "block";
        }
        else
        {
            obj.style.display = "none";
        }
    }
}

function searchGoods()
{
    var elements  = document.forms['theForm'].elements;
    var filters   = new Object;

    filters.cat_id = elements['cat_id'].value;
    filters.brand_id = elements['brand_id'].value;
    filters.keyword = Utils.trim(elements['keyword'].value);

    sz.loadOptions('get_goods_list', filters);
}
{/literal}

/**
 * 选取上级分类时判断选定的分类是不是底层分类
 */
function catChanged()
{
  var obj = document.forms['theForm'].elements['collection_cat'];

  cat_type = obj.options[obj.selectedIndex].getAttribute('cat_type');
  if (cat_type == undefined)
  {
    cat_type = 1;
  }

  if ((obj.selectedIndex > 0) && (cat_type == 2 || cat_type == 4))
  {
    alert(not_allow_add);
    obj.selectedIndex = 0;
    return false;
  }

  return true;
}
</script>
{include file="pagefooter.htm"}